package com.oig.sys.base.controller;


import com.oig.sys.base.service.ITbInnerAreaService;
import com.oig.sys.base.vo.InnerAreaVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "境内目的地地区码表管理")
@RestController
@RequestMapping("/innerArea")
@Slf4j
@RequiredArgsConstructor
public class TbInnerAreaController {

    private final ITbInnerAreaService innerAreaService;

    @Operation(summary = "查询境内目的地地区，根据编码或名称匹配", description = "这个数据从海关拿来初始化导入，暂时不提柜维护接口")
    @PostMapping(value = "/findTop")
    public List<InnerAreaVo> findTop(@RequestParam(value = "searchWord", required = false) String searchWord){
        log.debug("searchWord={}",searchWord);
        return innerAreaService.findTopInnerArea(searchWord);
    }


}
